package ch.doublet.jw.pubdownloader;

public class Publication {
	private String lang;
	private String pub;
	private String type;
	private int month;
	private int year;

	public Publication(String lang, String pub, String type, int month, int year) {
		this.lang = lang;
		this.pub = pub;
		this.type = type;
		this.month = month;
		this.year = year;
	}

	public String getDate() {
		String day = "";
		if (getPub() == "w") {
			day = "15";
		}
		if (this.month < 10) {
			return this.year + "0" + this.month + day;
		} else {
			return this.year + "" + this.month + day;
		}
	}

	public String getFileName() {

		return this.pub + "_" + this.lang + "_" + getDate() + "." + this.type;
	}

	public String getLang() {
		return lang;
	}

	public int getMonth() {
		return month;
	}

	public String getPub() {
		return pub;
	}

	public String getType() {
		return type;
	}

	public int getYear() {
		return year;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	public void setPub(String pub) {
		this.pub = pub;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setYear(int year) {
		this.year = year;
	}
}